home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: uu4news.netcom.com!zodiac!szh
- From: szh@zcon.com (Syed Zaeem Hosain)
- Subject: Re: What to do when feof() is NOT feof()
- Message-ID: <1996Feb19.063026.29889@zcon.com>
- Sender: szh@zcon.com (Syed Zaeem Hosain)
- Nntp-Posting-Host: zodiac
- Reply-To: szh@zcon.com
- Organization: Z Consulting Group
- References: <4g7rsj$fnf@spectator.cris.com>
- Date: Mon, 19 Feb 1996 06:30:26 GMT
-
- In article <4g7rsj$fnf@spectator.cris.com>, aubrey@concentric.net (Aubrey Harrison) writes:
- >In article <danpop.824614833@rscernix>, danpop@mail.cern.ch says...
- >>
- >>In <4g4vpp$52f@spectator.cris.com> aubrey@concentric.net (Aubrey Harrison)
- >writes:
- >>
- >>
- >>>I think if you open the file in "text" mode the end of the file is indicated
- >by
- >>>the EOF marker (ASCII 26 I believe). To avoid this you must open the file in
- >>>binary mode.
- >>
- >>Once again: ignorants and idiots are kindly asked to refrain from posting
- >>their thoughts and beliefs to this newsgroup.
- >>
- >>If you don't KNOW what you're talking about, just keep your "mouth" shut.
- >>This is comp.lang.c, not talk.rumors.
- >>
- >>Dan
- >>--
- >>Dan Pop
- >>CERN, CN Division
- >>Email: danpop@mail.cern.ch
- >>Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
- >
- >Who died and left you king. Most of the messages I have read from you do
- >nothing but harass and ridicule people, rarely ever offering an help or
- >suggestions.
-
- I would have to differ. Dan has always offered *correct* advice when it
- is called for. While I do not necessarily always agree with his way of
- doing so, his point here is still well taken.
-
- When somebody is asking a question about something (that they are
- obviously unknowledgable or confused about), giving them incorrect
- answers only propagates the confusion. So please don't guess, please
- don't offer any incorrect suggestions, please don't confuse them
- further, etc.
-
- >I may not be an expert but I know if you open a file with fopen(
- >"filename", "rt"), then fgets stops reading when it finds a ascii 26 and
- >signals end-of-file. If you open it with fopen( "filename","rb") it reads until
- >the real end-of-file. I noticed in your smart-ass reply you did not offer any
- >answers to his problem. Maybe you should take you own advice.
-
- On my SunOS system, there is no such ascii 26 byte denoting end of file
- and fgets will *not* terminate in this manner. The point is that by
- making such incorrect responses (like you did by insisting on this
- point) is just plain wrong. It has nothing to do with the language or
- how the end of files are denoted in most operating systems. Even in
- PC's running MSDOS, there is no such requirement that there *must* be
- an ascii 26 at the end of text files. Certain editors (Brief is an
- example. microEMacs is another) can easily be configured to create such
- ascii files without this byte.
-
- Note that even the EOF result returned (look in stdio.h) has nothing to
- do with the actual byte at the end of the file.
-
- The bottom line still is: please do not offer answers if you do not
- know the correct answer.
-
- Z
-
-
- --
- -------------------------------------------------------------------------
- | Syed Zaeem Hosain P. O. Box 610097 (408) 441-7021 |
- | Z Consulting Group San Jose, CA 95161 szh@zcon.com |
- -------------------------------------------------------------------------
-